package com.zws.cucumber.plugin;

import io.cucumber.plugin.event.EventPublisher;

public interface ZwsPlugin {

    String getName();

    int getPriority();

    default void init0(EventPublisher publisher) {}

    default void init1(EventPublisher publisher) {}

    default void init(ZwsPluginChain chain, EventPublisher publisher) {
        try {
            init0(publisher);
            chain.invokeNext(publisher);
        } finally {
            init1(publisher);
        }
    }

}
